home *** CD-ROM | disk | FTP | other *** search
-
- ;***********************************************************************
- ***********************
- ;*
- *
- ;* FILE: ANTI-MON.ASM (c) 1993
- *
- ;* PURPOSE: Detect and remove a TSR anti-viral monitor
- *
- ;* AUTHOR: Willoughby DATE: 05/09/93
- *
- ;*
- *
- ;***********************************************************************
- ***********************
-
- MAIN SEGMENT BYTE
- ASSUME CS:MAIN,DS:MAIN,ES:MAIN
-
- ORG 100H
-
- ;***********************************************************************
- ***********************
- ;The purpose of this routine is simply to demonstrate the function of
- the FIND_AV_MON and
- ;NEUT_AV_MON routines. It displays a message based upon the results of
- the test for TSR anti-
- ;viral monitor interrupt vectors performed by the FIND_AV_MON routine
- and the action taken, if
- ;needed, by the NEUT_AV_MON routine.
-
- START: call FIND_AV_MON ;check for installed
- anti-viral monitors
- jc MP1 ;if carry is set, a
- monitor is present
- mov dx,OFFSET NOT_HERE_MSG ;if not, display
- appropriate message
- jmp MPEX ;during exit
- MP1: cmp WORD PTR [MONITOR_TYPE],0 ;check for type/version
- of monitor present
- mov dx,OFFSET MON0_HERE_MSG
- je MP2 ;if MONITOR_TYPE = 0,
- display v1.0 message
- mov dx,OFFSET MON1_HERE_MSG ;otherwise, display v6.0
- message
- MP2: mov ah,9
- int 21H
- call NEUT_AV_MON ;then restore vectors to
- original values
- mov dx,OFFSET BUT_NOW_MSG ;display monitor removal
- message
- MPEX: mov ah,9
- int 21H
- mov ax,4C00H ;exit program
- int 21H
-
- NOT_HERE_MSG:
- DB 0DH,0AH,'VSAFE is not present.',0DH,0AH,24H
- MON0_HERE_MSG:
- DB 0DH,0AH,7,'VSAFE v1.0 is present.',0DH,0AH,24H
- MON1_HERE_MSG:
- DB 0DH,0AH,7,'MS-DOS 6.0 VSAFE is present',0DH,0AH,24H
- BUT_NOW_MSG:
- DB 0DH,0AH,'But now, it just APPEARS to be.',0DH,0AH,24H
-
-
- ;***********************************************************************
- ***********************
- ;This routine tests for the presence in memory of two versions of VSAFE
- by comparing the
- ;offsets of the interrupt vectors stolen during VSAFE's installation
- with known VSAFE interrupt
- ;handler offsets. When it finds any three offset values in the system
- interrupt vector table
- ;which match the VSAFE offsets for the corresponding interrupt, the
- carry flag is set to
- ;indicate the presence of VSAFE in memory to the calling routine. The
- segment in which VSAFE
- ;resides is stored in MONITOR_SEGMENT and the VSAFE version stored in
- MONITOR_TYPE for use by
- ;the NEUT_AV_MON routine.
-
- NUM_MONITORS EQU 2 ;# of anti-viral monitor
- types to check for
- NUM_VECTORS EQU 8 ;# of interrupt vector
- table entries to check
- MATCHES_REQ EQU 3 ;# of offset matches
- required for positive ID
-
- FIND_AV_MON:
- push es
- xor ax,ax
- mov es,ax ;set ES to segment of
- interrupt vector table
- mov cx,NUM_VECTORS ;set loop counter to #
- of vectors to check
- mov si,OFFSET VECTOR_OFFSETS ;point SI to start of
- vector offset string
- FAMLP1: lodsw ;load vector table
- offset of first vector
- mov bx,ax
- mov dx,w[es:bx] ;load offset of vector
-